﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using Xunit;

namespace OpenLinkCommon.UnitTest.Utilities
{
    using Windy.OpenLink;

    public class CollecionExtensionTest
    {
        private void SequenceEqual<T>(IEnumerable<T> expected, IEnumerable<T> actual)
        {
            Assert.Equal(expected.ToArray(), actual.ToArray());
        }

        [Fact()]
        public void AddRangeArray()
        {
            Collection<string> c = new Collection<string>();

            string [] test = new string[]{"a","b","c"};

            c.AddRange("a", "b", "c");

            SequenceEqual(test, c);

            c.Clear();

            var linq = from fo in test
                       select fo;

            c.AddRange(linq);

            SequenceEqual(test, c);
        }
    }
}

